package com.wyh.filemanager.util;

public class FileCategoryUtil {

	public enum FileCategory {
		Music, Video, Picture, Apk, Txt, Other
	}

	public static FileCategory getFileCatogeryFromPath(String path) {
		String mimeType = MimeUtil.getMimeType(path);

		if (mimeType.startsWith("audio/")) {
			return FileCategory.Music;
		} else if (mimeType.startsWith("video/")) {
			return FileCategory.Video;
		} else if ("application/vnd.android.package-archive".endsWith(mimeType)) {
			return FileCategory.Apk;
		} else if (mimeType.startsWith("image/")) {
			return FileCategory.Picture;
		} else if (mimeType.startsWith("text/")) {
			return FileCategory.Txt;
		}
		return FileCategory.Other;
	}
}
